{% load i18n %}

<div class="navbar navbar-static-top accounts">
    <div class="navbar-inner">
        <div class="container-fluid">
            {# This is used in mobile view #}
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".account-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>

            <div class="nav-collapse account-collapse">
                <div class="container-fluid">
                    {% if LANGUAGES|length > 1 %}
                        <form id="language_selector" class="pull-left navbar-form" action="/i18n/setlang/" method="post">
                            {% csrf_token %}
                            <select name="language">
                                {% for language in LANGUAGES %}
                                <option value="{{ language.0 }}" {% if LANGUAGE_CODE == language.0 %}selected="selected"{% endif %}>{{ language.1 }}</option>
                                {% endfor %}
                            </select>
                            <button class="btn" type="submit">Go</button>
                        </form>
                    {% endif %}
                    <ul class="nav pull-right">
                        {% if user.is_authenticated %}
                            <li>
                                <a href="{% url customer:summary %}">{% trans "Account" %}</a>
                            </li>
                            <li>
                                <a href="{% url customer:notifications-inbox %}">
                                    {% trans "Notifications" %}
                                    {% if num_unread_notifications > 0 %}
                                        <span class="label label-important">{{ num_unread_notifications }}</span>
                                    {% endif %}</a>
                            </li>
                            {% if user.is_staff %}
                                <li><a href="{% url dashboard:index %}">{% trans "Dashboard" %}</a></li>
                            {% endif %}
                            <li><a href="{% url customer:logout %}">{% trans "Logout" %}</a></li>
                        {% else %}
                            <li><a href="{% url customer:login %}">{% trans "Login or register" %}</a></li>
                        {% endif %}
                    </ul>
                </div>
            </div>

        </div>
    </div>
</div>
